-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(radio-button): add a bit of padding to radio button example #7433
Conversation
@@ -1 +1,4 @@ | |||
/** No CSS for this example */ | |||
.mat-radio-button:not(:last-child) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a little more robust as:
.mat-radio-button + .mat-radio-button {
margin-left: 16px;
}
Also the comment isn't really necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crisbeto I think the way I did it allows for more flexibility. If someone has an element other than a .mat-radio-button
as a sibling, then I think yours breaks down; whereas with my way, you could have a radio button, some other element, and then another radio button and mine would still put a bit of space.
That being said, I think your way might be faster. What do you think about doing .mat-radio-button ~ .mat-radio-button
? Using this should allow us to select all the radio button siblings, no matter if they are immediately adjacent or not and would still be a little faster than :not()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works as well. My only issue with the first approach was it could've broken if we shuffled the DOM around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to add the CSS file to the component? e.g. a styleUrl here:
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
A spoonful of padding helps the
radio-buttons
go down! ☂️Before:
After: